<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Purchase extends Model
{
    use HasFactory;
    protected $table='purchase';


    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }

    public function product()
    {
        return $this->hasOne(Products::class,'id','product_id');
    }

    public function admin()
    {
        return $this->hasOne(Admins::class,'id','admin_id');
    }

}
